<script>
	const router = ['navigateTo', 'redirectTo', 'reLaunch', 'switchTab', 'navigateBack'];
	let route = '';

	function pagesInterceptor() {
		router.forEach((item, index) => {
			uni.addInterceptor(item, {
				invoke(args) {
					console.log(`${item}/invoke: ${JSON.stringify(args)}`);
					let strRoute = JSON.stringify(args); 
					{
						// 页面跳转后的操作
					}
					route = JSON.parse(strRoute).url;
				}
			})
		})
	}
	
	export default {
		onLaunch: function() {
			console.log('App Launch');
		},
		onShow: function() {
			console.log('App Show');
			pagesInterceptor();
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
	* {
		touch-action: pan-y;
	}
</style>
